package com.erp.quertz.emailQuertz;

import com.danga.MemCached.MemCachedClient;
import com.erp.erp_servers.Email.EmailService;
import com.erp.erp_servers.Email.Impl.EmailServiceImpl;
import com.erp.erp_ui.email.EmailControl;
import com.erp.quertz.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * Spring 整合 Quartz 的  Hello World!
 * @author dufy
 * @date 2017.02.26
 * 定时发送邮件
 */
@Slf4j
public class EmailSend implements Job  {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        /*ImpCustomerService customerService = SpringUtil.getBean(ImpCustomerService.class);
        customerService.getCustomerAndUserAndSupplier();*/

       /* System.out.println("This is a first spring combine quartz !");
        System.out.println("Welcome to Spring_Quartz World!"+ new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) );
        System.out.println("Let's begin ! \n \n");*/
        try {
            EmailServiceImpl service= SpringUtil.getBean(EmailServiceImpl.class);
           send s=send.getsend();
           s.send(service);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("中断");
        }

    }
}
